#ifndef WKUBS_H
#define WKUBS_H

#include <QGLWidget>
#include <QMouseEvent>
#include "pozicijas.h"

#include "ArcBall.h"

class kubs : public QGLWidget
{
    Q_OBJECT
public:
  kubs(QWidget *parent);

 static  Matrix4fT   mTransform;
 static   Matrix3fT   LastRot;
static  Matrix3fT  ThisRot;
ArcBallT  *  ArcBall;
Point2fT    MousePt;
bool        isClicked ;										// NEW: Clicking The Mouse?
//bool        isRClicked;										// NEW: Clicking The Right Mouse Button?
bool        isDragging ;
int gajsk,tekmx,tekmy;
bool ispressed;
int centrsx,centrsy;
int vietas[24];
int gajieni[15];
int vsturi [8];
void atrsturus();
void zimet();
void pagriezt(int pagr);
void kombinet(int * viet );
double truetg(int x,int  y);
 double truetgd(double y,double  x);
void simgr(int pagr);
void invert();
void meklet();
int salidz(int * viet);
 char rez[24];
char poz[24];

const static int sturuvietas[][8];
const static  int sturi[][3];
const static  int sturip[][3];
const static int krasas[6][3];
const static float malas[][4][3];
const static int pagriezieni[][24];
const static int simpag[][24];
protected:
void initializeGL();
 void resizeGL(int w, int h);
void paintGL();
  void mousePressEvent(QMouseEvent *event);
     void mouseMoveEvent(QMouseEvent *event);

     void mouseReleaseEvent(QMouseEvent *event);

    public slots:
    void sark();
    void zals();
    void zils();
    void dzelt();
    void cian();
    void viol();
    void sarkm();
    void zalsm();
    void zilsm();
    void dzeltm();
    void cianm();
    void violm();
void sakartot();

     signals:
void showpos(int x,int y);
     void cuberotated(int pag);
     void anglech();

};



#endif // WKUBS_H
